#ifndef _NE_GL_BUFFER_OBJECT_MANAGER_H_
#define _NE_GL_BUFFER_OBJECT_MANAGER_H_

#include <common/Singleton.h>
#include <graphics/GLBufferObject.h>

namespace ne
{
    class NEAPI GLBufferObjectManager : public Singleton<GLBufferObjectManager>
    {
        public:
            GLBufferObjectManager();

            GLBufferObjectPtr createBufferObject(const BufferType bt, const BufferUsage usage, const uint32_t length);

            GLBufferObjectPtr getBufferObject(const uint32_t source) const;

            bool hasBufferObject(const uint32_t source) const;

            bool removeByPtr(GLBufferObjectPtr pBuffer);

            bool removeBySource(const uint32_t source);

            void removeAll();

            virtual ~GLBufferObjectManager();

        public:
            static GLBufferObjectManager& GetSingleton();

            static GLBufferObjectManager* GetSingletonPtr();

        private:
            GLBufferObjectMap mGLBufferObjectMap;
    };
}

#endif
